package com.lan.viewObject;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Map;

@Data
@NoArgsConstructor
public class Query<T> {

    /**
     * 当前页
     * */
    private int page = 1;

    /**
     * 每页条数
     * */
    private int limit = 10;

    private String name;
    private T t;

    public Query(Map<String, Object> params) {
        if (null != params.get("page")) {
            this.page = Integer.parseInt((String) params.get("page"));
        }
        if (null != params.get("limit")) {
            this.limit = Integer.parseInt((String) params.get("limit"));
        }
        this.name = (String)params.get("name");
    }
}
